<template>
  <el-menu :router="true" mode="horizontal" class="navbar" background-color="#fff" text-color="#2c3e50" active-text-color="#409EFF">
    <el-menu-item index="/">
      <img src="@/assets/logo.png" alt="Logo" class="logo" />
      惊喜一餐
    </el-menu-item>
    <div class="menu-items">
      <el-menu-item index="/">首页</el-menu-item>
      <el-menu-item index="/restaurant-list">餐厅</el-menu-item>
      <el-menu-item index="/user">用户信息</el-menu-item>
    </div>
  </el-menu>
</template>

<script>
export default {
  name: 'Navbar'
};
</script>

<style scoped>
.navbar {
  padding: 0 20px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.logo {
  width: 40px;
  height: 40px;
  vertical-align: middle;
  margin-right: 10px;
}

.el-menu-item {
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.el-menu-item:hover {
  background-color: #f5f7fa !important;
  color: #409EFF !important;
}

.menu-items {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.el-menu--horizontal > .el-menu-item.is-active {
  border-bottom: 2px solid #409EFF;
}

@media (max-width: 768px) {
  .el-menu-item {
    font-size: 14px;
  }

  .menu-items {
    justify-content: space-around;
  }
}
</style>